import http from '@/api/http';
const base = '/api/';
export default {
  // ======
  // 免登工具类 : 免登工具类接口
  // ======
  // 设置请求头
  async setAuthorization(params) {
    return await http.setAuthorization(params);
  },
  // 签名
  async getJsConfig(params) {
    return await http.get(`${base}auth/getJsConfig`, params);
  },
  async getPcJsConfig(params) {
    return await http.get(`${base}auth/getPcJsConfig`, params);
  },
  // 拉取用户信息{"code":"获取到的code"}
  async getUserInfo(params) {
    return await http.post(`${base}logindingding/getUserInfo`, params);
  },
  //用户图片上传 {"file":"文件路径"}
  async fileUpload(params) {
    return await http.post(`${base}logindingding/fileUpload`, params);
  },
  // 用户压缩图片上传  {"file":"文件路径"}
  async uploadImg2Oss(params) {
    return await http.post(`${base}logindingding/uploadImg2Oss`, params);
  },

  // ======
  // approvalconfig : 后台审批流设置approvalConfig接口
  // ======
  //根据id删除ApprovalConfig {"id":"id"}
  async approvalConfig_delete(params) {
    return await http.post(`${base}approvalConfig/delete`, params);
  },
  //修改ApprovalConfig {"id":"id","code":"审批流程编码","user_ids":"需要审批的id组","name":"审批流程名称"}
  async approvalConfig_edit(params) {
    return await http.post(`${base}approvalConfig/edit`, params);
  },
  // 根据Id查询ApprovalConfig {"id":"id"}
  async approvalConfig_findById(params) {
    return await http.post(`${base}approvalConfig/findById`, params);
  },
  //分页查询ApprovalConfig {"start":"从第几条开始查询","limit":"查询多少条"}
  async approvalConfig_list(params) {
    return await http.post(`${base}approvalConfig/list`, params);
  },
  //新增ApprovalConfig  {"code":"审批流程编码","user_ids":"需要审批的id组","name":"审批流程名称","auditorList":{"level":"审批等级","auditorId":"审批人id","name":"审核人名称","role_type":"角色类型（1-上级领导，2-区域领导，3-hr）"}}
  async approvalConfig_saveApprovel(params) {
    return await http.post(`${base}approvalConfig/saveApprovel`, params);
  },

  // ======
  // examine : 考核填写表examine接口
  // ======
  // 根据id删除Examine {"id":"id"}
  async examine_delete(params) {
    return await http.post(`${base}examine/delete`, params);
  },
  // 修改Examine {"id":"id","quarter_id":"季度考核主表","quarter_name":"季度考核名称","status":"审核标记","user_id":"提交人","user_name":"提交人名称"}
  async examine_edit(params) {
    return await http.post(`${base}examine/edit`, params);
  },
  // 根据Id查询Examine {"id":"id"}
  async examine_findById(params) {
    return await http.post(`${base}examine/findById`, params);
  },
  // 分页查询Examine {"start":"从第几条开始查询","limit":"查询多少条"}
  async examine_list(params) {
    return await http.post(`${base}examine/list`, params);
  },
  //  查询可以打分的全部Examine数据 {}
  async examine_listAll(params) {
    return await http.post(`${base}examine/listAll`, params);
  },
  //新增Examine {"quarter_id":"季度考核主表","quarter_name":"季度考核名称","examineList":{"question_code":"题目编码","question_type":"题目类型:1-价值观，question_name 考核标准。2-工作绩效","task":"考核内容","rare":"考核占比"}}
  async examine_save(params) {
    return await http.post(`${base}examine/save`, params);
  },
  // 根据Id重新提交审核 {"id":"id"}
  async examine_reSubmitaudit(params) {
    return await http.post(`${base}examine/reSubmitaudit`, params);
  },
  // 根据Id撤销Examine {"id":"id"}
  async examine_repeal(params) {
    return await http.post(`${base}examine/repeal`, params);
  },

  // ======
  // exmapproval : 考核指标审核操作
  // ======
  // 审核操作
  async exmApproval_audit(params) {
    return await http.post(`${base}exmApproval/audit`, params);
  },
  // 筛选根据名字
  async exmApproval_listByName(params) {
    return await http.post(`${base}exmApproval/listByName`, params);
  },
  // 分页查询我审核的数据 {"start":"从第几条开始查询","limit":"查询多少条"}
  async exmApproval_listDone(params) {
    return await http.post(`${base}exmApproval/listDone`, params);
  },
  //分页查询待我审核的数据 {"start":"从第几条开始查询","limit":"查询多少条"}
  async exmApproval_listPending(params) {
    return await http.post(`${base}exmApproval/listPending`, params);
  },

  // ======
  // quarter : 季度考核设置quarter接口
  // ======
  // 根据id删除Quarter {"id":"id"}
  async quarter_delete(params) {
    return await http.post(`${base}quarter/delete`, params);
  },
  //修改Quarter  {"id":"id","name":"考核名称","start_date":"开始时间","end_date":"结束时间","state":"state"}
  async quarter_edit(params) {
    return await http.post(`${base}quarter/edit`, params);
  },
  //根据Id查询Quarter {"id":"id"}
  async quarter_findById(params) {
    return await http.post(`${base}quarter/findById`, params);
  },
  //分页查询Quarter {"start":"从第几条开始查询","limit":"查询多少条"}
  async quarter_list(params) {
    return await http.post(`${base}quarter/list`, params);
  },
  //查询已经启用的考核数据Quarter {}
  async quarter_listAll(params) {
    return await http.post(`${base}quarter/listAll`, params);
  },
  //新增Quarter {"name":"考核名称","start_date":"开始时间","end_date":"结束时间"}
  async quarter_save(params) {
    return await http.post(`${base}quarter/save`, params);
  },

  // ======
  // score : 打分接口类
  // ======
  // 根据Id确认评分Score {"examine_id":"考核id","is_appeal":"申诉：0-无，1有"}
  async score_appealScore(params) {
    return await http.post(`${base}score/appealScore`, params);
  },
  //根据Id确认评分Score
  async score_confirmScore(params) {
    return await http.post(`${base}score/confirmScore`, params);
  },
  //  根据id删除Score {"examine_id":"考核id"}
  async score_delete(params) {
    return await http.post(`${base}score/delete`, params);
  },
  // 修改Score {"examine_id":"考核id", "markList":{"id":"id","examineb_id":"题目表id","messge":"评价","score":"得分"}}
  async score_edit(params) {
    return await http.post(`${base}score/edit`, params);
  },
  //根据Id查询自己的评分内容Score {"examine_id":"考核id"}
  async score_findById(params) {
    return await http.post(`${base}score/findById`, params);
  },
  // 自评部分
  async score_listAll(params) {
    return await http.post(`${base}score/listAll`, params);
  },
  // 自评列表
  async score_listExamine(params) {
    return await http.post(`${base}score/listExamine`, params);
  },
  //新增Score {"examine_id":"考核id", "markList":{"examine_id":"考核id","examineb_id":"题目表id","messge":"评价","score":"得分","user_id":"评价人id","user_name":"评价人名称","score_type":"评价类型：0-自评，1-他人评价"}}
  async score_save(params) {
    return await http.post(`${base}score/save`, params);
  },
  // 个人申诉接口 传id就行
  async examine_toAppeal(params) {
    return await http.post(`${base}examine/toAppeal`, params);
  },
  // 个人确认得分接口
  async examine_confirm(params) {
    return await http.post(`${base}examine/confirm`, params);
  },

  // ======
  // scoreapproval : 评分审核操作
  // ======
  //审核操作 {"recordId":"审批流程id","status":"审批状态： 1通过 2 驳回","moduleId":"考核审批的id：quarter_id"}
  async scoreApproval_audit(params) {
    return await http.post(`${base}scoreApproval/audit`, params);
  },
  //分页查询我审核的数据 {"start":"从第几条开始查询","limit":"查询多少条"}
  async scoreApproval_listDone(params) {
    return await http.post(`${base}scoreApproval/listDone`, params);
  },
  //分页查询待我审核的数据  {"start":"从第几条开始查询","limit":"查询多少条"}
  async scoreApproval_listPending(params) {
    return await http.post(`${base}scoreApproval/listPending`, params);
  },
  // 查询是否可以进行评分审核
  async scoreApproval_findById(params) {
    return await http.post(`${base}scoreApproval/findById`, params);
  },
  // 搜索通过名字
  async scoreApproval_listByName(params) {
    return await http.post(`${base}scoreApproval/listByName`, params);
  },
  // ======
  // performancemanager : 绩效考核后台管理
  // ======
  //  根据Id查询Examine {"id":"id"}
  async performance_findById(params) {
    return await http.post(`${base}performance/findById`, params);
  },
  // 修改评分信息以及评价信息
  async performance_editScore(params) {
    return await http.post(`${base}performance/editScore`, params);
  },
  // 分页查询Examine  {"start":"从第几条开始查询","limit":"查询多少条"}
  async performance_list(params) {
    return await http.post(`${base}performance/list`, params);
  },
  // 备注预览
  async performance_findMessageById(params) {
    return await http.post(`${base}performance/findMessageById`, params);
  },
  // 下发得分 id
  async performance_issuedScore(params) {
    return await http.post(`${base}performance/issuedScore`, params);
  },
  // 同意或者拒绝申诉 id加is_appeal=2 同意is_appeal=3拒绝
  async performance_appeal(params) {
    return await http.post(`${base}performance/appeal`, params);
  },
  // 导出ids 逗号分割
  async performance_expExcel(params) {
    return await http.postBlob(`${base}performance/expExcel`, params);
  },
};

// `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
//   `quarter_id` int(11) unsigned DEFAULT '0' COMMENT '季度考核主表',
//   `quarter_name` varchar(255) DEFAULT '' COMMENT '季度考核名称',
//   `status` tinyint(1) unsigned DEFAULT '0' COMMENT '审核标记',
//   `user_id` varchar(255) DEFAULT '' COMMENT '提交人',
//   `user_name` varchar(255) DEFAULT '' COMMENT '提交人名称',
//   `hiredate` varchar(255) DEFAULT '' COMMENT '入职时间',
//   `me_score` decimal(18,2) unsigned DEFAULT NULL COMMENT '我的评分',
//   `end_score` decimal(18,2) unsigned DEFAULT NULL COMMENT '最终评分',
//   `values_score` decimal(18,2) unsigned DEFAULT NULL COMMENT '价值观分数',
//   `work_score` decimal(18,2) unsigned DEFAULT NULL COMMENT '工作绩效分数',
//   `is_appeal` tinyint(1) unsigned DEFAULT '0' COMMENT '申诉：0-无，1有',
//   `me_date` timestamp NULL DEFAULT NULL COMMENT '自我评分时间',
//   `approve_date` timestamp NULL DEFAULT NULL COMMENT '审核结束时间',
//   `create_user` int(11) unsigned DEFAULT '0' COMMENT '创建人id',
//   `modifytime` timestamp NULL DEFAULT NULL COMMENT '更新时间',
//   `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
//   `approve_status` tinyint(1) DEFAULT NULL COMMENT '评分审核状态',
